# Data Manipulation libraries:
import io
import pandas as pd
from copy import deepcopy
from sklearn.preprocessing import MinMaxScaler
# Plotting libraries:
import seaborn as sns
import plotly.express as px
import matplotlib.pyplot as plt
import plotly.graph_objects as go
from plotly.subplots import make_subplots
This code is to import and read a csv file stored in your local system
isl_df = pd.read_csv(r"C:\Users\AMIT PAREEK\Documents\project deploment\Football-Anaytics-with-Python-main\isl_player_final.csv")
isl_df.head()
| tour_id | tour_name | id | jersey_no | name | short_name | position_id | position | position_short | team_id | ... | goaltenders.catches | goaltenders.punches | goaltenders.penalty_kicks.shots_faced | goaltenders.penalty_kicks.goals_allowed | goaltenders.penalty_kicks.saves | country_id | country_name | dob | player_foot | height | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 148 | ISL6 | 1514 | 3 | Asamoah Gyan | Asamoah Gyan | 2 | Forward | FWD | 504 | ... | 0 | 0 | 0 | 0 | 0 | 43 | Ghana | NaN | NaN | NaN |
| 1 | 148 | ISL6 | 2475 | 26 | Deshorn Dwayne Brown | Deshorn Brown | 2 | Forward | FWD | 656 | ... | 0 | 0 | 0 | 0 | 0 | 56 | Jamaica | 12/22/1990 | Right | 187.0 |
| 2 | 148 | ISL6 | 2900 | 9 | Amine Chermiti | Amine Chermiti | 2 | Forward | FWD | 506 | ... | 0 | 0 | 0 | 0 | 0 | 106 | Tunisia | 12/26/1987 | left | 177.0 |
| 3 | 148 | ISL6 | 3753 | 7 | Francisco Medina Luna | Piti | 3 | Midfielder | MF | 1159 | ... | 0 | 0 | 0 | 0 | 0 | 19 | Spain | 5/26/1981 | left | 179.0 |
| 4 | 148 | ISL6 | 3809 | 4 | Rafael Lopez Gomez | Rafael Lopez Gomez | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 19 | Spain | 4/9/1985 | right | 183.0 |
5 rows × 93 columns
Explore and prepare your data for the required analysis to be performed. Eg., we are going to analyse goalkeepers, so we need to filter out and remove all the data from positions other than GK.
# Check all the unique positions in the data:
isl_df.drop_duplicates(subset=["position_id"])[["position_id", "position"]]
| position_id | position | |
|---|---|---|
| 0 | 2 | Forward |
| 3 | 3 | Midfielder |
| 4 | 1 | Defender |
| 9 | 4 | Goalkeeper |
# Slice (Filter) dataframe only to retain information about GKs:
isl_df[(isl_df["minutes_played"] > 1500) & (isl_df["country_id"] == 1)].shape
isl_df[(isl_df["position_id"] == 1) & (isl_df["minutes_played"] > 1000) & (isl_df["country_id"] == 1)]
| tour_id | tour_name | id | jersey_no | name | short_name | position_id | position | position_short | team_id | ... | goaltenders.catches | goaltenders.punches | goaltenders.penalty_kicks.shots_faced | goaltenders.penalty_kicks.goals_allowed | goaltenders.penalty_kicks.saves | country_id | country_name | dob | player_foot | height | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 26 | 148 | ISL6 | 10256 | 21 | Narayan Das | Narayan Das | 1 | Defender | DEF | 1499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 9/25/1993 | Left | 175.0 |
| 28 | 148 | ISL6 | 10624 | 33 | Prabir Das | Prabir Das | 1 | Defender | DEF | 499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 12/20/1993 | Right | 172.0 |
| 44 | 148 | ISL6 | 10694 | 10 | Harmanjot Singh Khabra | Harmanjot Khabra | 1 | Defender | DEF | 656 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 3/18/1988 | right | 181.0 |
| 47 | 148 | ISL6 | 10712 | 20 | Pritam Kotal | Pritam Kotal | 1 | Defender | DEF | 499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/9/1993 | Right | 179.0 |
| 50 | 148 | ISL6 | 10770 | 5 | Raju Eknath Gaikwad | Raju Gaikwad | 1 | Defender | DEF | 498 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 9/25/1990 | Right | 180.0 |
| 67 | 148 | ISL6 | 16577 | 13 | Gurtej Singh | Gurtej Singh | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 5/2/1990 | right | 181.0 |
| 76 | 148 | ISL6 | 19129 | 12 | Keisham Reagan Singh | Reagan Singh | 1 | Defender | DEF | 504 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 4/1/1991 | Right | 173.0 |
| 91 | 148 | ISL6 | 21201 | 2 | Rahul Shankar Bheke | Rahul Bheke | 1 | Defender | DEF | 656 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 12/6/1990 | right | 179.0 |
| 107 | 148 | ISL6 | 26616 | 2 | Pratik Prabhakar Chaudhari | Pratik Chaudhari | 1 | Defender | DEF | 506 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 10/4/1989 | right | 186.0 |
| 111 | 148 | ISL6 | 26713 | 18 | Jerry Lalrinzuala | Jerry Lalrinzuala | 1 | Defender | DEF | 505 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 7/13/1998 | Left | 0.0 |
| 125 | 148 | ISL6 | 30980 | 22 | Nishu Kumar Tashni | Nishu Kumar | 1 | Defender | DEF | 656 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 1/1/1997 | Left | 178.0 |
| 134 | 148 | ISL6 | 31824 | 20 | Seriton Benny Fernandes | Seriton Fernandes | 1 | Defender | DEF | 496 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 6/1/1993 | Right | 0.0 |
| 146 | 148 | ISL6 | 31875 | 15 | Subhasish Prodyut Bose | Subhasish Bose | 1 | Defender | DEF | 506 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/18/1995 | Left | 186.0 |
| 168 | 148 | ISL6 | 35065 | 16 | Sarthak Golui | Sarthak Golui | 1 | Defender | DEF | 506 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 3/11/1997 | Right | 187.0 |
| 181 | 148 | ISL6 | 35281 | 33 | Rakesh Pradhan | Rakesh Pradhan | 1 | Defender | DEF | 504 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/2/1997 | NaN | NaN |
| 193 | 148 | ISL6 | 36329 | 44 | Asish Rai | Asish Rai | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 2/2/1999 | Right | 176.0 |
| 195 | 148 | ISL6 | 36441 | 2 | Sumit Rathi | Sumit Rathi | 1 | Defender | DEF | 499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 26-08-2001 | NaN | NaN |
| 200 | 148 | ISL6 | 36795 | 15 | Shubham Sarangi | Shubham Sarangi | 1 | Defender | DEF | 1499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 6/24/2000 | right | 179.0 |
| 216 | 148 | ISL6 | 55646 | 2 | Mohamad Rakip | Mohamad Rakip | 1 | Defender | DEF | 498 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 5/14/2000 | right | 0.0 |
| 244 | 148 | ISL6 | 68806 | 14 | Jessel Allan Carneiro | Jessel Carneiro | 1 | Defender | DEF | 498 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 265 | 202 | ISL7 | 3988 | 5 | Gurjinder Kumar | Gurjinder Kumar | 1 | Defender | DEF | 504 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 287 | 202 | ISL7 | 10255 | 17 | Mandar Rao Dessai | Mandar Rao Dessai | 1 | Defender | DEF | 506 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 3/18/1992 | Left | 171.0 |
| 288 | 202 | ISL7 | 10256 | 21 | Narayan Das | Narayan Das | 1 | Defender | DEF | 1102 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 9/25/1993 | Left | 175.0 |
| 289 | 202 | ISL7 | 10624 | 33 | Prabir Das | Prabir Das | 1 | Defender | DEF | 1874 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 12/20/1993 | Right | 172.0 |
| 291 | 202 | ISL7 | 10641 | 5 | Sandesh Jhingan | Sandesh Jhingan | 1 | Defender | DEF | 1874 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 304 | 202 | ISL7 | 10710 | 12 | Ashutosh Mehta | Ashutosh Mehta | 1 | Defender | DEF | 504 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 305 | 202 | ISL7 | 10712 | 20 | Pritam Kotal | Pritam Kotal | 1 | Defender | DEF | 1874 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/9/1993 | Right | 179.0 |
| 326 | 202 | ISL7 | 19129 | 2 | Keisham Reagan Singh | Reagan Singh | 1 | Defender | DEF | 505 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 4/1/1991 | Right | 173.0 |
| 342 | 202 | ISL7 | 21201 | 2 | Rahul Shankar Bheke | Rahul Bheke | 1 | Defender | DEF | 656 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 12/6/1990 | right | 179.0 |
| 358 | 202 | ISL7 | 26611 | 4 | Chinglensana Singh Konsham | Chinglensana Singh | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 11/23/1996 | Right | 186.0 |
| 362 | 202 | ISL7 | 26713 | 18 | Jerry Lalrinzuala | Jerry Lalrinzuala | 1 | Defender | DEF | 505 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 7/13/1998 | Left | 0.0 |
| 380 | 202 | ISL7 | 31791 | 4 | Amey Ganesh Ranawade | Amey Ranawade | 1 | Defender | DEF | 506 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 3/7/1998 | NaN | 0.0 |
| 386 | 202 | ISL7 | 31824 | 20 | Seriton Benny Fernandes | Seriton Fernandes | 1 | Defender | DEF | 496 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 6/1/1993 | Right | 0.0 |
| 396 | 202 | ISL7 | 31875 | 15 | Subhasish Prodyut Bose | Subhasish Bose | 1 | Defender | DEF | 1874 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/18/1995 | Left | 186.0 |
| 428 | 202 | ISL7 | 35224 | 26 | Laldinliana Renthlei | Laldinliana Renthlei | 1 | Defender | DEF | 1159 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 8/26/1998 | NaN | 0.0 |
| 435 | 202 | ISL7 | 35274 | 16 | Ricky Lallawmawma | Ricky Lallawmawma | 1 | Defender | DEF | 1159 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 9/9/1991 | Left | 0.0 |
| 447 | 202 | ISL7 | 36315 | 22 | Deepak Tangri | Deepak Tangri | 1 | Defender | DEF | 505 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 1/1/1999 | Right | 177.0 |
| 448 | 202 | ISL7 | 36317 | 13 | Gaurav Bora | Gaurav Bora | 1 | Defender | DEF | 1499 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 7/13/1998 | right | 175.0 |
| 455 | 202 | ISL7 | 36329 | 44 | Asish Rai | Asish Rai | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 2/2/1999 | Right | 176.0 |
| 485 | 202 | ISL7 | 55653 | 21 | Saviour Gama | Saviour Gama | 1 | Defender | DEF | 496 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | 0000-00-00 | NaN | 0.0 |
| 493 | 202 | ISL7 | 58793 | 3 | Soraisham Sandeep Singh | Sandeep Singh | 1 | Defender | DEF | 498 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 499 | 202 | ISL7 | 63446 | 31 | Akash Mishra | Akash Mishra | 1 | Defender | DEF | 1536 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
| 517 | 202 | ISL7 | 68806 | 14 | Jessel Allan Carneiro | Jessel Carneiro | 1 | Defender | DEF | 498 | ... | 0 | 0 | 0 | 0 | 0 | 1 | India | NaN | NaN | NaN |
43 rows × 93 columns
# Save the sliced dataframe in a variable for further use:
indian_defenders= deepcopy(isl_df[(isl_df["position_id"] == 1) & (isl_df["minutes_played"] > 1000) & (isl_df["country_id"] == 1)])
indian_defenders.reset_index(drop=True,inplace=True)
# First thing to always do before starting analysis is to see generic meta-level information about your dataframe:
indian_defenders.info()
<class 'pandas.core.frame.DataFrame'> RangeIndex: 43 entries, 0 to 42 Data columns (total 93 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 tour_id 43 non-null int64 1 tour_name 43 non-null object 2 id 43 non-null int64 3 jersey_no 43 non-null int64 4 name 43 non-null object 5 short_name 43 non-null object 6 position_id 43 non-null int64 7 position 43 non-null object 8 position_short 43 non-null object 9 team_id 43 non-null int64 10 team_name 43 non-null object 11 team_short_name 43 non-null object 12 is_started 43 non-null int64 13 is_onbench 43 non-null int64 14 is_goalkeeper 43 non-null int64 15 is_substitute 43 non-null int64 16 minutes_played 43 non-null int64 17 bonus_points 43 non-null int64 18 injury_minutes_played 43 non-null int64 19 actual_minutes_played 43 non-null int64 20 goaltenders 43 non-null int64 21 events.goals 43 non-null int64 22 events.own_goals 43 non-null int64 23 events.assists 43 non-null int64 24 events.key_passes 43 non-null int64 25 events.chances_created 43 non-null int64 26 events.shots 43 non-null int64 27 events.shots_on_target 43 non-null int64 28 events.shots_off_target 43 non-null int64 29 events.fouls_committed 43 non-null int64 30 events.fouls_suffered 43 non-null int64 31 events.yellow_cards 43 non-null int64 32 events.red_cards 43 non-null int64 33 events.is_second_yellow_card 43 non-null int64 34 events.offsides 43 non-null int64 35 events.corner_kicks 43 non-null int64 36 events.crosses 43 non-null int64 37 events.free_kicks 43 non-null int64 38 events.throw_in 43 non-null int64 39 events.punches 43 non-null int64 40 events.catches 43 non-null int64 41 events.goals_conceded 43 non-null int64 42 events.clean_sheet 43 non-null int64 43 events.cleansheet 43 non-null int64 44 events.fantasy_assists 43 non-null int64 45 events.penalties_saved 43 non-null int64 46 events.penalties_earned 43 non-null int64 47 events.penalties_conceded 43 non-null int64 48 events.penalties_missed 43 non-null int64 49 events.freekicks_conceded_goal 43 non-null int64 50 events.freekicks_earned_goal 43 non-null int64 51 events.blocked_shots 43 non-null int64 52 events.defensive_blocked_shots 43 non-null int64 53 events.penalty_kicks.total 43 non-null int64 54 events.penalty_kicks.goals 43 non-null int64 55 touches.total 43 non-null int64 56 touches.total_passes 43 non-null int64 57 touches.good_passes 43 non-null int64 58 touches.bad_passes 43 non-null int64 59 touches.interceptions 43 non-null int64 60 touches.blocks 43 non-null int64 61 touches.tackles 43 non-null int64 62 touches.successful_tackles 43 non-null int64 63 touches.unsuccessful_tackles 43 non-null int64 64 touches.clearance 43 non-null int64 65 touches.saves 43 non-null int64 66 touches.take_on_total 43 non-null int64 67 touches.take_on_successful 43 non-null int64 68 touches.take_on_unsuccessful 43 non-null int64 69 touches.last_man_tackle_successful 43 non-null int64 70 touches.last_man_tackle_unsuccessful 43 non-null int64 71 touches.successful_passes 43 non-null int64 72 touches.interceptions_won 43 non-null int64 73 touches.aerial_duel.total 43 non-null int64 74 touches.aerial_duel.won 43 non-null int64 75 touches.aerial_duel.lost 43 non-null int64 76 touches.ground_duel.total 43 non-null int64 77 touches.ground_duel.won 43 non-null int64 78 touches.ground_duel.lost 43 non-null int64 79 goaltenders.shots_faced 43 non-null int64 80 goaltenders.shots_on_goal_faced 43 non-null int64 81 goaltenders.goals_allowed 43 non-null int64 82 goaltenders.saves 43 non-null int64 83 goaltenders.catches 43 non-null int64 84 goaltenders.punches 43 non-null int64 85 goaltenders.penalty_kicks.shots_faced 43 non-null int64 86 goaltenders.penalty_kicks.goals_allowed 43 non-null int64 87 goaltenders.penalty_kicks.saves 43 non-null int64 88 country_id 43 non-null int64 89 country_name 43 non-null object 90 dob 36 non-null object 91 player_foot 31 non-null object 92 height 34 non-null float64 dtypes: float64(1), int64(82), object(10) memory usage: 31.4+ KB
# After you have fairly had an overview of your dataframe, next step is to look at some basic statistics for numerical columns:
indian_defenders.describe().round(1)
| tour_id | id | jersey_no | position_id | team_id | is_started | is_onbench | is_goalkeeper | is_substitute | minutes_played | ... | goaltenders.shots_on_goal_faced | goaltenders.goals_allowed | goaltenders.saves | goaltenders.catches | goaltenders.punches | goaltenders.penalty_kicks.shots_faced | goaltenders.penalty_kicks.goals_allowed | goaltenders.penalty_kicks.saves | country_id | height | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | ... | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 34.0 |
| mean | 176.9 | 28949.3 | 16.0 | 1.0 | 878.1 | 16.2 | 3.2 | 0.0 | 3.4 | 1443.7 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 131.2 |
| std | 27.3 | 16937.0 | 11.0 | 0.0 | 513.9 | 3.2 | 2.4 | 0.0 | 3.2 | 270.7 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 80.0 |
| min | 148.0 | 3988.0 | 2.0 | 1.0 | 496.0 | 11.0 | 0.0 | 0.0 | 0.0 | 1002.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 0.0 |
| 25% | 148.0 | 10741.0 | 5.0 | 1.0 | 501.5 | 13.0 | 1.0 | 0.0 | 1.5 | 1183.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 42.8 |
| 50% | 202.0 | 30980.0 | 15.0 | 1.0 | 506.0 | 17.0 | 3.0 | 0.0 | 3.0 | 1504.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 175.5 |
| 75% | 202.0 | 36316.0 | 21.0 | 1.0 | 1499.0 | 18.0 | 5.0 | 0.0 | 4.5 | 1620.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 179.0 |
| max | 202.0 | 68806.0 | 44.0 | 1.0 | 1874.0 | 22.0 | 7.0 | 0.0 | 13.0 | 1980.0 | ... | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 187.0 |
8 rows × 83 columns
Pro-tip: If all the columns of a datarame are not displayed, use the pandas set_option function to display any number of columns you wish.
# We will set display max columns to 85 since we have 83 columns in our gk_df:
pd.set_option("display.max_columns", 85)
# Let's run the describe function again to see the change:
indian_defenders.describe().round(1)
| tour_id | id | jersey_no | position_id | team_id | is_started | is_onbench | is_goalkeeper | is_substitute | minutes_played | bonus_points | injury_minutes_played | actual_minutes_played | goaltenders | events.goals | events.own_goals | events.assists | events.key_passes | events.chances_created | events.shots | events.shots_on_target | events.shots_off_target | events.fouls_committed | events.fouls_suffered | events.yellow_cards | events.red_cards | events.is_second_yellow_card | events.offsides | events.corner_kicks | events.crosses | events.free_kicks | events.throw_in | events.punches | events.catches | events.goals_conceded | events.clean_sheet | events.cleansheet | events.fantasy_assists | events.penalties_saved | events.penalties_earned | events.penalties_conceded | events.penalties_missed | events.freekicks_conceded_goal | events.freekicks_earned_goal | events.blocked_shots | events.defensive_blocked_shots | events.penalty_kicks.total | events.penalty_kicks.goals | touches.total | touches.total_passes | touches.good_passes | touches.bad_passes | touches.interceptions | touches.blocks | touches.tackles | touches.successful_tackles | touches.unsuccessful_tackles | touches.clearance | touches.saves | touches.take_on_total | touches.take_on_successful | touches.take_on_unsuccessful | touches.last_man_tackle_successful | touches.last_man_tackle_unsuccessful | touches.successful_passes | touches.interceptions_won | touches.aerial_duel.total | touches.aerial_duel.won | touches.aerial_duel.lost | touches.ground_duel.total | touches.ground_duel.won | touches.ground_duel.lost | goaltenders.shots_faced | goaltenders.shots_on_goal_faced | goaltenders.goals_allowed | goaltenders.saves | goaltenders.catches | goaltenders.punches | goaltenders.penalty_kicks.shots_faced | goaltenders.penalty_kicks.goals_allowed | goaltenders.penalty_kicks.saves | country_id | height | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 43.0 | 34.0 |
| mean | 176.9 | 28949.3 | 16.0 | 1.0 | 878.1 | 16.2 | 3.2 | 0.0 | 3.4 | 1443.7 | 0.0 | 84.3 | 1534.2 | 0.0 | 0.2 | 0.0 | 0.8 | 7.9 | 8.6 | 5.8 | 1.8 | 2.8 | 18.3 | 15.2 | 3.3 | 0.1 | 0.1 | 0.8 | 2.1 | 27.2 | 8.2 | 127.1 | 0.0 | 0.0 | 18.3 | 0.0 | 5.2 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.2 | 0.0 | 0.0 | 0.0 | 840.2 | 549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38.0 | 63.0 | 149.0 | 0.0 | 78.0 | 24.0 | 10.0 | 1.0 | 0.0 | 0.0 | 0.0 | 55.0 | 30.0 | 25.0 | 2.0 | 2.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.0 | 187.0 |
# Numerical exploration:
defender_mins_df = indian_defenders.groupby(["id", "name"])["minutes_played"].sum().reset_index()
defender_mins_df
| id | name | minutes_played | |
|---|---|---|---|
| 0 | 3988 | Gurjinder Kumar | 1519 |
| 1 | 10255 | Mandar Rao Dessai | 1082 |
| 2 | 10256 | Narayan Das | 2982 |
| 3 | 10624 | Prabir Das | 2860 |
| 4 | 10641 | Sandesh Jhingan | 1892 |
| 5 | 10694 | Harmanjot Singh Khabra | 1619 |
| 6 | 10710 | Ashutosh Mehta | 1406 |
| 7 | 10712 | Pritam Kotal | 3870 |
| 8 | 10770 | Raju Eknath Gaikwad | 1022 |
| 9 | 16577 | Gurtej Singh | 1035 |
| 10 | 19129 | Keisham Reagan Singh | 3135 |
| 11 | 21201 | Rahul Shankar Bheke | 2345 |
| 12 | 26611 | Chinglensana Singh Konsham | 1523 |
| 13 | 26616 | Pratik Prabhakar Chaudhari | 1488 |
| 14 | 26713 | Jerry Lalrinzuala | 2649 |
| 15 | 30980 | Nishu Kumar Tashni | 1466 |
| 16 | 31791 | Amey Ganesh Ranawade | 1564 |
| 17 | 31824 | Seriton Benny Fernandes | 3338 |
| 18 | 31875 | Subhasish Prodyut Bose | 3181 |
| 19 | 35065 | Sarthak Golui | 1148 |
| 20 | 35224 | Laldinliana Renthlei | 1237 |
| 21 | 35274 | Ricky Lallawmawma | 1674 |
| 22 | 35281 | Rakesh Pradhan | 1350 |
| 23 | 36315 | Deepak Tangri | 1007 |
| 24 | 36317 | Gaurav Bora | 1620 |
| 25 | 36329 | Asish Rai | 2554 |
| 26 | 36441 | Sumit Rathi | 1170 |
| 27 | 36795 | Shubham Sarangi | 1409 |
| 28 | 55646 | Mohamad Rakip | 1290 |
| 29 | 55653 | Saviour Gama | 1878 |
| 30 | 58793 | Soraisham Sandeep Singh | 1150 |
| 31 | 63446 | Akash Mishra | 1800 |
| 32 | 68806 | Jessel Allan Carneiro | 2816 |
px.bar(x="name", y="minutes_played", text="minutes_played", data_frame=defender_mins_df)
indian_defenders["interceptionsPer90"] = indian_defenders["touches.interceptions"].divide(indian_defenders["minutes_played"]).multiply(90)
indian_defenders["blocksPer90"] = indian_defenders["touches.blocks"].divide(indian_defenders["minutes_played"]).multiply(90)
indian_defenders["tacklesPer90"] = indian_defenders["touches.tackles"].divide(indian_defenders["minutes_played"]).multiply(90)
indian_defenders["clearancePer90"] = indian_defenders["touches.clearance"].divide(indian_defenders["minutes_played"]).multiply(90)
indian_defenders["tackles_sucessPer90"] = indian_defenders["touches.successful_tackles"].divide(indian_defenders["minutes_played"]).multiply(90)
px.bar(x="name", y="blocksPer90", text="blocksPer90", data_frame=indian_defenders)
px.bar(x="name", y="tacklesPer90", text="tacklesPer90", data_frame=indian_defenders)
px.bar(x="name", y="interceptionsPer90", text="interceptionsPer90", data_frame=indian_defenders)
px.bar(x="name", y="clearancePer90", text="clearancePer90", data_frame=indian_defenders)
px.bar(x="name", y="tackles_sucessPer90", text="tackles_sucessPer90", data_frame=indian_defenders)
cols_for_radar=["interceptionsPer90","blocksPer90","tacklesPer90","clearancePer90","tackles_sucessPer90"]
from sklearn.preprocessing import MinMaxScaler
scaler = MinMaxScaler()
indian_defenders[cols_for_radar] = scaler.fit_transform(indian_defenders[cols_for_radar])
for i, row in indian_defenders.iterrows():
print(row["name"])
fig = px.line_polar(indian_defenders, r=indian_defenders.loc[(indian_defenders["id"] == row["id"]), cols_for_radar].sum(),
theta=cols_for_radar, line_close=True,
title=row["name"])
fig.update_traces(fill='toself')
fig.show()
Narayan Das
Prabir Das
Harmanjot Singh Khabra
Pritam Kotal
Raju Eknath Gaikwad
Gurtej Singh
Keisham Reagan Singh
Rahul Shankar Bheke
Pratik Prabhakar Chaudhari
Jerry Lalrinzuala
Nishu Kumar Tashni
Seriton Benny Fernandes
Subhasish Prodyut Bose
Sarthak Golui
Rakesh Pradhan
Asish Rai
Sumit Rathi
Shubham Sarangi
Mohamad Rakip
Jessel Allan Carneiro
Gurjinder Kumar
Mandar Rao Dessai
Narayan Das
Prabir Das
Sandesh Jhingan
Ashutosh Mehta
Pritam Kotal
Keisham Reagan Singh
Rahul Shankar Bheke
Chinglensana Singh Konsham
Jerry Lalrinzuala
Amey Ganesh Ranawade
Seriton Benny Fernandes
Subhasish Prodyut Bose
Laldinliana Renthlei
Ricky Lallawmawma
Deepak Tangri
Gaurav Bora
Asish Rai
Saviour Gama
Soraisham Sandeep Singh
Akash Mishra
Jessel Allan Carneiro
We have analyzed various aspect for finding best defender among all the parameters that we have sets. important feature selection had done on the data and tackles,interception,clearnance,blocks are very import parameter to decide a best defenders.After this I can say that Ashish rai is front runner in terms of statics and followed by Subhasish Prodyut Bose,Pritam Kotal.